package com.example.LinuxSpringBoot.Controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;


@Controller
@RequestMapping("/hello")
@Slf4j//日志打印
public class HelloController {
    @GetMapping
    @ResponseBody
    public String hello() {
        log.info("\nhello");
        return "<h1>I am lh?😊</h1>";
    }

    @PostMapping
    @ResponseBody
    public String hello2() {
        return "{name:liuhe}";
    }

    @DeleteMapping
    @ResponseBody
    public String hello3() {
        return "删除:{name:liuhe}";
    }

    @RequestMapping("/r")
    public String hello4() {
        return "Request:{name:liuhe}";
    }
}